//
// Created by Administrator on 2024/6/14.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define FAIL    0
#define SUCCESS 1

typedef enum{
    STUDENTS_111 = 1,
    STUDENTS_222,
    STUDENTS_333
}STUDENTS_INFO_NUM;

typedef void (*GET_SUTDENTS_NAME_INFO_Fucptr)(char *pBuf, STUDENTS_INFO_NUM sutdentsNum);

GET_SUTDENTS_NAME_INFO_Fucptr GET_SUTDENTS_NAME_INFO_HOOK=NULL;

int egRegGetStudentsInfoFunc(GET_SUTDENTS_NAME_INFO_Fucptr pGetStudentsInfoFuc)
{
    if(pGetStudentsInfoFuc == NULL)
    {
        return FAIL;
    }
    GET_SUTDENTS_NAME_INFO_HOOK = pGetStudentsInfoFuc;

    return SUCCESS;
}

void getStudentsInfoEntry()
{
    char *students_111_name = "KaiYing Z";
    char *students_222_name = "TianZe F";
    char *students_333_name = "WuMing R";
    char *pBuf;

    pBuf = students_111_name;
    GET_SUTDENTS_NAME_INFO_HOOK(pBuf, STUDENTS_111);

    pBuf = students_222_name;
    GET_SUTDENTS_NAME_INFO_HOOK(pBuf, STUDENTS_222);

    pBuf = students_333_name;
    GET_SUTDENTS_NAME_INFO_HOOK(pBuf, STUDENTS_333);
}